﻿<!DOCTYPE html>
<html ng-app="demoApp">
<head>
    <title id="Description">Using AngularJS ngModel with jQWidgets</title>
    <link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" />
    <script type="text/javascript" src="../../scripts/angular.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxradiobutton.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript">
        var demoApp = angular.module("demoApp", ["jqwidgets"]);

        demoApp.controller("demoController", function ($scope) {
            $scope.user = {
                name: "Brian",
                working: true,
                birthDate: "1980-03-02",
                friends: [
                    "Peter",
                    "Nancy",
                    "Michael",
                    "John",
                    "Robert"
                ],
                bestFriend: "Peter",
                married: true,
                color: "Blue",
                car: true,
                children: 'YES',
                age: 16
            };
        });
    </script>
</head>
<body>
    <div ng-controller="demoController">
        <form name="userForm">
            <jqx-input jqx-width="200" jqx-height="25" name="userName" ng-model="user.name"></jqx-input>
            <br />
            <br />
            <jqx-date-time-input jqx-width="200" jqx-height="25" jqx-format-string="'yyyy-MM-dd'" ng-model="user.birthDate"></jqx-date-time-input>
            <br />
            <jqx-number-input jqx-input-mode="'simple'" jqx-decimal-digits="0" jqx-digits="2" jqx-spin-buttons="true" ng-model="user.age"></jqx-number-input>
            <br />
            <jqx-drop-down-list jqx-auto-drop-down-height="true" jqx-width="200" jqx-height="25" jqx-source="user.friends" ng-model="user.bestFriend"></jqx-drop-down-list>
            <br />
            <jqx-check-box ng-model="user.working">Working</jqx-check-box>
            <br />
            <jqx-radio-button jqx-group-name="'married'" value="true" ng-model="user.married">Married</jqx-radio-button>
            <br />
            <jqx-radio-button jqx-group-name="'married'" value="false" ng-model="user.married">Not Married</jqx-radio-button>
            <br />
            Favorite Color:
            <br />
            <br />
            <jqx-radio-button jqx-group-name="'colors'" value="'Green'" ng-model="user.color">Green</jqx-radio-button>
            <br />
            <jqx-radio-button jqx-group-name="'colors'" value="'Blue'" ng-model="user.color">Blue</jqx-radio-button>
            <br />
            <jqx-check-box ng-model="user.car">Car</jqx-check-box>
            <br />
            <jqx-check-box ng-true-value="'YES'" ng-false-value="'NO'" ng-model="user.children">Children</jqx-check-box>
        </form>
        <pre>user.name = <span ng-bind="user.name"></span></pre>
        <pre>user.working = <span ng-bind="user.working"></span></pre>
        <pre>user.birthDate = <span ng-bind="user.birthDate"></span></pre>
        <pre>user.bestFriend = <span ng-bind="user.bestFriend"></span></pre>
        <pre>user.married = <span ng-bind="user.married"></span></pre>
        <pre>user.color = <span ng-bind="user.color"></span></pre>
        <pre>user.car = <span ng-bind="user.car"></span></pre>
        <pre>user.children = <span ng-bind="user.children"></span></pre>
        <pre>user.age = <span ng-bind="user.age"></span></pre>
    </div>
</body>
</html>
